//
//  SmallButtonViewCell.m
//  quxiangtao
//
//  Created by HHuajiang on 2018/11/19.
//  Copyright © 2018 shanhaijin. All rights reserved.
//

#import "SmallButtonViewCell.h"

@implementation SmallButtonViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        UIImageView *image = [[UIImageView alloc] init];
        [self addSubview:image];
        [image mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.mas_centerX);
            make.top.mas_equalTo(Margin);
            make.size.mas_equalTo(CGSizeMake(Scale_W(42), Scale_W(42)));
        }];
        
        UILabel *label = [[UILabel alloc] init];
        label.textColor = Color333333;
        label.font = Font(24);
        [self addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(0);
            make.centerX.equalTo(self.mas_centerX);
        }];
        
        
        self.smallImage = image;
        self.smallTitle = label;
    }
    return self;
}


- (void)setModel:(ButtonReusaViewModel *)model {
    [self.smallImage sd_setImageWithURL:[NSURL URLWithString:model.photo]];
    self.smallTitle.text = model.title;
}
@end
